package com.bojiu.lawsearch.lawsearch.service.impl;

import com.bojiu.lawsearch.lawsearch.mapper.UserQuestionMapper;
import com.bojiu.lawsearch.lawsearch.model.OrderMessage;
import com.bojiu.lawsearch.lawsearch.model.UserQuestion;
import com.bojiu.lawsearch.lawsearch.service.QuestionService;
import com.bojiu.lawsearch.lawsearch.util.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.concurrent.DelayQueue;

/**
 * @author: afdiao
 * @Date：2020/3/23 23:53
 * @Description:
 */
@Service
@Slf4j
public class QuestionServiceImpl implements QuestionService {

    @Autowired
    UserQuestionMapper userQuestionMapper;

    @Autowired
    DelayQueue<OrderMessage> orderMessages;

    @Override
    public JsonResult publishQuestion(UserQuestion question, int userId) {
        //TODO：判断用户账户是否有足够的钱，先用积分后用余额，余额不够充值

        //
        question.setUserId(userId);

        return null;
    }
}
